package org.challenge.bean;

public class Maestro {

	public void doMaintenance(Vehicle v) {
		try {
			if (!v.rotatedTires) {
				v.rotateTires();
			}
			else {
				System.out.println(v.make + " " + v.model + " has it tires already rotated.");
			}
			if(v instanceof ICombustionEngine) {
				if(((ICombustionEngine) v).getOilLevel() == 100.0) {
					System.out.println(v.make + " " + v.model + " oil level is already full");
				}
				else {
					((ICombustionEngine) v).changeOil();
				}
			}
		} catch(NullPointerException e) {
			e.printStackTrace();
		}
	}


}
